//
//  YSStorageManager.h
//  YSBookRead
//
//  Created by Kyson on 2018/11/6.
//  Copyright © 2018 YangShen. All rights reserved.
//
//  数据存储管理 归档/解档

#import <Foundation/Foundation.h>

@class YSReaderSetting, YSReadBookModel, YSBookChapterModel, YSReadRecordModel, YSBookSummaryModel;

@interface YSStorageManager : NSObject

/// 阅读设置
+ (void)updateSetting:(YSReaderSetting *)setting;
+ (YSReaderSetting *)getSetting;

/// 阅读的书籍模型
+ (void)saveReadBook:(YSReadBookModel *)readBook;
+ (YSReadBookModel *)getReadBook:(NSString *)bookID;

/// 章节列表
+ (void)saveBookChapterList:(NSArray<YSBookChapterModel *> *)bookChapterList bookID:(NSString *)bookID summaryID:(NSString *)summaryID;
+ (NSArray<YSBookChapterModel *> *)getBookChapterList:(NSString *)bookID summaryID:(NSString *)summaryID;

/// 阅读历史记录
+ (void)saveReadRecord:(YSReadRecordModel *)readRecord;
+ (YSReadRecordModel *)getReadRecord:(NSString *)bookID;

/// 单章节模型内容
+ (void)saveBookChapterBody:(NSString *)bookID chapterID:(NSString *)chapterID body:(NSString *)body;
+ (NSString *)getBookChapterBody:(NSString *)bookID chapterID:(NSString *)chapterID;

/// 书籍来源
+ (void)saveBookSummary:(YSBookSummaryModel *)bookSummary bookID:(NSString *)bookID;
+ (YSBookSummaryModel *)getBookSummary:(NSString *)bookID;


@end
